#include "PAP_defs.h"
#include "derivative.h"

#define SPI_PRESCALER_1 0
#define SPI_PRESCALER_2 1
#define SPI_PRESCALER_3 2
#define SPI_PRESCALER_4 3
#define SPI_PRESCALER_5 4
#define SPI_PRESCALER_6 5
#define SPI_PRESCALER_7 6
#define SPI_PRESCALER_8 7

#define SPI_BAUDRATE_DIVIDER_2      0
#define SPI_BAUDRATE_DIVIDER_4      1
#define SPI_BAUDRATE_DIVIDER_8      2
#define SPI_BAUDRATE_DIVIDER_16     3
#define SPI_BAUDRATE_DIVIDER_32     4
#define SPI_BAUDRATE_DIVIDER_64     5
#define SPI_BAUDRATE_DIVIDER_128    6
#define SPI_BAUDRATE_DIVIDER_256    7

#define SPI_ENABLED     1
#define SPI_DISABLED    0

#define SPI_MASTER_MODE 1
#define SPI_SLAVE_MODE  0

void vfnSPI_PrescalerSelect (uint8 u8prescaler);

void vfnSPI_BaudRateSelect (uint8 u8baudrate);

void vfnSPI_SetSystemStatus (uint8 u8status);

void vfnSPI_ModeSelect (uint8 u8mode);

uint8 u8SPI_RxPending (void);

uint8 u8SPI_TxComplete (void);

uint8 u8SPI_ReadData (void);

void vfnSPI_SendByte (uint8 u8byte);

void vfnSPI_Delay(uint8 u8delay);

void vfnSPI_Init (void);